package com.sea.supply.mapper;

import com.sea.supply.entity.Receive;
import com.sea.supply.entity.WareProduce;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *  接收单接口
 * @author 陈鸿飞
 * <br/>
 */
public interface WareProduceMapper {


    /**
     * 新增
     * @param wareProduce
     * @return
     */
    int insert(WareProduce wareProduce);

    /**
     * 查询可接收数量
     * @param wareProduce
     * @return
     */
    WareProduce findReceiveNumber(WareProduce wareProduce);

    /**
     * 条件查询
     * @param wareProduce
     * @return
     */
    List<WareProduce> findByCnd(WareProduce wareProduce);

    List<WareProduce> getDistributeNumber(@Param("receiveSku")String receiveSku,@Param("receiveChannelName")String receiveChannelName);

    WareProduce findDistributeNumber(WareProduce wareProduce);
    /**
     * 更新占有量
     * @param useNumber
     * @param id
     * @return
     */
    int updateUseNumber(@Param("useNumber")Integer useNumber,@Param("id")Integer id);

    WareProduce findById(Integer id);

    Integer getDistributeNumberBySkuChannel(@Param("receiveSku")String receiveSku,@Param("receiveChannelName")String receiveChannelName);

    /**
     * 查询指定
     * @param wareProduce
     * @return
     */
    WareProduce findWareProduce(WareProduce wareProduce);


}